import request from "@/utils/request";

//获取个人信息·
export const getMyDate=(userId)=>{
    return request.get(`/user/${userId}`)
}


//传递个人信息,进行修改
export const PushXinxi=(userId,userNickname,userGender,userMajor,token)=>{
    return request.put('/user',{
        userId:userId,
        userNickname:userNickname,
        userGender:userGender,
        userMajor:userMajor,
        token:token
    })
}
//上传头像
export const changeTouxiang=(userId,userAvatar)=>{
    return request.post(`/user/upload?userId=${userId}`,{
        userAvatar:userAvatar
    }
  )
}

//获取我的帖子数据
export const getMyPost =(postUid)=>{
    return request.get(`/post/${postUid}`)
}
//删除帖子
export const deletePost=(postId)=>{
    return request.delete(`/post/${postId}`)
}

// 获取我的评论数据`
export const getMyCommend = (userId)=>{
    return request.get(`/comment/user/${userId}`)
}
// 删除评论
export const deleteCommend=(commentId)=>{
    return request.delete(`/comment/${commentId}`)
}
// 查询发贴用户的id
export const findPostId=(postId)=>{
    return request.get(`/post/id/?postId=${postId}`,
    )
}

//查看他人的信息
export const lookXinxi=(userId)=>{
    return request.get(`/user/${userId}`)
}


//修改我的收藏
export const getMyShoucang=(userId)=>{
    return request.get(`/staff/user/${userId}`)
}